package com.wy.panda.service.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wy.panda.common.base.service.PandaServiceImpl;
import com.wy.panda.common.page.PageResult;
import com.wy.panda.dao.criteria.SysDictCriteria;
import com.wy.panda.dao.mapper.SysDictMapper;
import com.wy.panda.entity.SysDictEntity;
import com.wy.panda.manager.SysDictManager;
import com.wy.panda.service.SysDictService;

import lombok.AllArgsConstructor;

/**
 * 数据字典
 *
 * @author wangyuan
 * @date 2020-09-11 23:46:39
 */
@AllArgsConstructor
@Service("sysDictService")
public class SysDictServiceImpl extends PandaServiceImpl<SysDictMapper, SysDictEntity> implements SysDictService {
    
    private final SysDictManager sysDictManager;
    
    @Override
    public PageResult<SysDictEntity> listPage(SysDictCriteria criteria) {
        IPage<SysDictEntity> page = criteria.page();
        page = page(page);
        
        return PageResult.build(page);
    }

    @Override
    public SysDictEntity getById(Serializable id) {
        return sysDictManager.getById(id);
    }

    @Override
    public List<SysDictEntity> listByIds(Collection<? extends Serializable> idList) {
        return sysDictManager.listByIds(idList);
    }
}